<?php
$numClients = 5;


for ($i=0; $i<$numClients; $i++) {
	$fps[] = fsockopen('127.0.0.1', 23);
}

foreach ($fps as $num => $fp) {
    echo fread($fp, 1024) . "\n";
}


foreach ($fps as $num => $fp) {
	fwrite($fp, 'message ' . $num);
//	echo fread($fp, 1024) . "\n";
}



foreach ($fps as $num => $fp) {
    fclose($fp);
}